http://stevelosh.com/blog/2010/08/a-git-users-guide-to-mercurial-queues/
http://hgbook.red-bean.com/read/mercurial-in-daily-use.html
x1#-- create .hgrc in home dir2$cd ~3$vim .hgrc4[ui]5username = Xianwei Zhang <xianweiz@nvidia.com>6editor = vim78[extensions]9mq =10#-- create repo. setting up a new Mercurial project11$hg init .12#ignore files using a set of glob patterns and regular expressions13$touch .hgignore14#-- track files (place the files under version control), include names matching the given patterns. done, "?" --> "A"15$hg add -I "*.cpp"16$hg add -I "*.hpp"17$hg add -I "*.c"18$hg add -I "*.h"19$find . -name "*.cpp" | xargs hg add20# tells which files Mercurial doesn't know about (uses a "?" to display such files)21# by default, `hg status` only tells about interesting files -- modified, removed or renamed, etc22$hg status23# stop tracking a file24$hg remove <file>25$hg status # a removed file is represented in the output of `hg status` with a "R"26# Mercurial considers a file that u have deleted, but not used `hg remove` to delete, to be missing ("!")27$rm <file>28$hg status29# want the missing file to stay gone30$hg remove --after <file>31$hg status32# on the other hand, recover the missing file33$hg revert <file>34$hg status35#-- check files36$hg status -q37#-- untrack38$hg forget *39#-- commit, preserve files in the repo40#-- after commit, added files will no longer be listed in the output of `hg status`41$hg commit -m "msg"42#-- list commits43$hg log
xxxxxxxxxx301#-- prepares a rep to work with MQ. This cmd creates an empty directory called ".hg/patches", where MQ will keep its metadata2$hg qinit3#-- to begin work on a new patch4$hg qq -c xianwei_smart5$hg qq6patches7xianwei_smart (active)8## --9# create a single patch with `hg qnew <NAME>`10# make changes in ur working directory11# use `hg qrefresh` to put them into the patch12# `hg qfinish` once u'r done with the patch and ready for it to become a commit13## --14#create a "patch holder" which will contain the changes that we make15#-- create a "patch holder" which will contain the changes that we make16#-- also newly present in the ".hg/patches" directory are two other files, "series" and "status"; the "series" file lists all the patches that MQ knows about for this repo, and "status" file tracks all of the patches that MQ has applied in this repo17$hg qnew mod1.patch18.hg/patches-xianwei_smart/mod1.patch19#-- edit files20$vim vts_datapath.cpp21#-- see changes22$hg dif23#-- update the patch with the new changes; this cmd folds the changes u have made in the working directory into your patch, and updates its corresponding changeset to contain those changes24$hg qrefresh25#-- see record patch changes26$vim .hg/patches-xianwei_smart/mod1.patch27#-- "qrefresh" is kind of checkpoint. afterwards, try an experiment, and it it doesn't work, "hg revert" your modifications back to the last time u refreshed28$hg revert29#-- once u'r done working on a patch and want to turn it into a permanent changeset30$hg qfinish
An applied patch has a corresponding changeset in the repo, and the effects of the patch and changeset are visible in the working directory. You can undo the application of a patch using the qpop command. MQ stills knows about, or manages, a popped patch, but the patch no longer has a corresponding changeset in the repo, and the working directory does not contain the changes made by the patch.
xxxxxxxxxx461#-- pop patches off the stack, removes applied patches2# "qpop -a": pop all applied patches3$hg qpop4popping mod1.patch5patch queue now empty6#-- push patches onto the stack; the patch's changes once again become present in the working directory7#-- "qpush -a": push all unapplied patches8$hg qpush9applying mod1.patch10nw at: mod1.patch11#-- list available patches12$hg qseries13#-- list applied patches14$hg qapplied1516#-- working on several patches at once17#-- "qrefresh" always refresh the topmost applied patch18#-- so, we can suspand work on one patch (by refreshing it), pop or push to make a different patch the top, and work on that patch for a while1920#-- do backup21$mkdir ~/Backups22$mv .hg ~/Backups/23$ls -s ~/Backups/.hg/ .2425$hg qq -c mem_packet_tracking26$hg help qimport27$hg qimport -e28/home/scratch.arg_nvresearch/patches_for_Xianwei/implement_restartQ.patch29$hg qimport -e30/home/scratch.arg_nvresearch/patches_for_Xianwei/track_packets_thru_mem_pipe.patch31# lists every patch that MQ knows about in this repository32$hg qser(ies)33implement_restartQ.patch34track_packets_thru_mem_pipe.patch35$vim .hg/patches-mem_packet_tracking/series36# lists every patch that MQ has applied in this repo37$hg qapplied38$hg status -a ./smartlib/sm_knob_db.cpp3940#push all unapplied patches41$hg qpush -a42#pop all applied patches43$$hg qpop -a4445#remove patch46$hg qq --purge mem_packet_tracking
xxxxxxxxxx1$p4 changes -m12Change 36868433 on 2016/07/19 by pgupta@internalClient_client.VVsKQC 'changes made due to change in t'3$vim /home/azulfiqar/.vimrc4$make clean all5$make vts -j8 > myBuild.txt6# DirDiff